import React from 'react'
import { Menu } from 'antd';
import { FileTextOutlined, ReconciliationOutlined, CloudServerOutlined } from '@ant-design/icons';
import styles from '../../styles/classroom/navMenu.scss'

export default function NavMenu({currentMenuIndex, setCurrentMenuIndex, setCurrentCourse}) {
    const handleClick = e => {
        setCurrentMenuIndex(e.key)
        if (e.key === 'borrow') {
            setCurrentCourse(1)
        }
    };
    return (
        <Menu onClick={handleClick} selectedKeys={[currentMenuIndex]} mode="horizontal">
            <Menu.Item key="info" icon={<FileTextOutlined />}>
                信息显示
            </Menu.Item>
            <Menu.Item key="borrow" icon={<CloudServerOutlined />}>
                借教室
            </Menu.Item>
        </Menu>
    )
}
